cmake_minimum_required(VERSION 3.20.0)

project(ByePass)

set(LLVM_DIR /Users/aserlili-m1/Documents/llvm/build/Ninja/Debug/lib/cmake/llvm/)

find_package(LLVM REQUIRED CONFIG)

list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)

separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})
include_directories(${LLVM_INCLUDE_DIRS})

# 设置 C++ 标准版本
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# add_subdirectory(BrainF)
# add_subdirectory(Fibonacci)
# add_subdirectory(HowToUseJIT)
# add_subdirectory(HowToUseLLJIT)
# add_subdirectory(IRTransforms)
# add_subdirectory(Kaleidoscope)
# add_subdirectory(ModuleMaker)
# add_subdirectory(OrcV2Examples)
# add_subdirectory(SpeculativeJIT)
add_subdirectory(Bye2)

if(LLVM_ENABLE_EH AND (NOT WIN32) AND (NOT "${LLVM_NATIVE_ARCH}" STREQUAL "ARM"))
    add_subdirectory(ExceptionDemo)
endif()

if( HAVE_PTHREAD_H )
  add_subdirectory(ParallelJIT)
endif( HAVE_PTHREAD_H )
